function changeEditUID(uid){
	j('#edit_uid').val(uid);
}

j(document).ready(function(){
	j('#social_networks').sortable({
		placeholder: 'ui-state-highlight',
		handle : '.ui-icon-grip-dotted-vertical',
		update : function () {
			var order = j('#social_networks').sortable('serialize');
			j.ajax({
				type: 'GET',
				url: '../typo3conf/ext/ttnews_share/mod1/process.php?process_sorting=1&'+order,
				cache: false,
				success: function(html){
					
				}
			});

		}

	});
	j('#social_networks').disableSelection();
	
	j('.input_checkbox input').click(function(){
		if(j(this).val() == 0){
			j(this).val(1);
		} else {
			j(this).val(0);
		}
		
		var attribute = j(this).attr('name');
		var hidden = j(this).val();
		var parent_id = j(this).parent().parent().attr('id');
		
		j.ajax({
			type: 'GET',
			url: '../typo3conf/ext/ttnews_share/mod1/process.php?process_hidden=1&uid='+attribute+'&hidden='+hidden,
			cache: false,
			success: function(html){
				if(hidden == 1){
					j('#'+parent_id).removeAttr('class');
					j('#'+parent_id).addClass('network');
					j('#'+parent_id).addClass('ui-state-highlight');
				} else {
					j('#'+parent_id).removeAttr('class');
					j('#'+parent_id).addClass('network');
					j('#'+parent_id).addClass('ui-state-default');
				}
			}
		});
	});
});